﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<%--<link rel="stylesheet" href="../../Content/css/layout.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../Content/css/jd.gallery.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../Content/css/ReMooz.css" type="text/css" media="screen" charset="utf-8" />--%>
<link rel="Stylesheet" href="../../Content/css/photoslider.css" type="text/css" media="screen" charset="utf-8" />

<%--<script src="../../Scripts/Jquery/jquery.gallery/mootools-1.2-more.js" type="text/javascript"></script>
<script src="../../Scripts/Jquery/jquery.gallery/mootools-1.2.1-core-yc.js"  type="text/javascript"></script>
<script src="../../Scripts/Jquery/jquery.gallery/jd.gallery.js" type="text/javascript"></script>
<script src="../../Scripts/Jquery/jquery.gallery/ReMooz.js" type="text/javascript"></script>--%>
<script src="../../Scripts/Jquery/photoslider.js" type="text/javascript"></script>
<%--<script type="text/javascript" src="../../Scripts/Jquery/imagebox_new.js"></script>--%>

<script type="text/javascript">

//    function startGallery() {

//        initJS();

//        var myGallery = new gallery($('myGallery'), {
//            
//            timed: false,
//            useReMooz: true,
//            embedLinks: false


//        });
//        
//        
//    }
//
    //    window.addEvent('domready', startGallery);

    $(document).ready(function() {

        var locationUrl = window.location.href;
        var arrUrl = locationUrl.split("/");
        var arr = arrUrl[arrUrl.length - 1];

        var TrademarkID = arr.split('?');
        //得到商户ID

        var arrTrademarkID = TrademarkID[1].split('&');
        var CityID1 = arrTrademarkID[0];
        var arrCityID = CityID1.split('=');
        var CityID = arrCityID[1];
        document.getElementById("backCity").href = '../../City/CityDetail/' + CityID;
        document.getElementById("backCountry").href = '../../Home/Index';
        document.getElementById("backCategory").href = '../../City/CityDetail/' + CityID;
        document.getElementById("backShop").href = '../../City/Trademark/' + arr;
        var ids = new Array();
        var shopID = "";
        //initJS();
        //        //change the 'baseURL' to reflect the host and or path to your images   
        //        FOTO.Slider.baseURL = 'http://example.com/path/';


        $.getJSON('/City/getShopImage/' + TrademarkID[0], { t: new Date() }, function(j) {
            if (j[0] == "nothing") {

                document.getElementById("myGallery").style["visibility"] = "hidden";
                document.getElementById("sp_messageMoreImg").innerHTML = "暂无任何图片信息!";
                document.getElementById("sp_messageMoreImg").style["visibility"] = "visible";

            } else {

                document.getElementById("myGallery").style["visibility"] = "visible";
                document.getElementById("sp_messageMoreImg").style["visibility"] = "hidden";

                for (var i = 0; i < j.length; i++) {

                    var value = j[i];

                    arr = value.split('|');
                    //得到商户ID
                    shopID = arr[1];
                    //得到IMG的NAME
                    var fileName = arr[0];
                    //添加值
                    ids.push(fileName);

                }

            }
            //得到图片信息
            FOTO.Slider.baseURL = '/Content/img/shop/81/' + shopID + "/";
            FOTO.Slider.importBucketFromIds('myGallery', ids);
            FOTO.Slider.message
            FOTO.Slider.reload('myGallery');
            FOTO.Slider.preloadImages('myGallery');
            FOTO.Slider.enableSlideshow('myGallery');

        })



    });

    function test() {
        alert(document.getElementById("myGallery").innerHTML);
    }
    
   
</script>

<table border="0" cellpadding="0" cellspacing="0" width="970px" height="650px" align="center" id="tb_moreImg" valign="top">
    <tr>
        <td>
            <span id="sp_messageMoreImg"></span>
        </td>
    </tr>
    <tr>
 
        <td align="right" width="100%"  style="border-style: none; border-color: inherit; border-width: medium; background-image:url('../../Content/img/shop/81/03/11/TopicTradmark.gif'); " 
            class="style5">
            <table align="left" cellpadding="0" cellspacing="0" border="0" width="100%">
                <tr>
                    <td width="100%" align="left">
                        <a id="backCountry" class="link"><span id="CountryName"></span> <%= Html.Encode(ViewData["CountryName"])%></a>-->
                        <a id="backCity" class="link"><span id="CityName"></span> <%= Html.Encode(ViewData["CityName"])%></a>-->
                        <a id="backCategory" class="link"><%= Html.Encode(ViewData["CategoryName"])%></a>-->
                        <a id="backShop" class="link"><%= Html.Encode(ViewData["ShopName"])%></a>
                    </td>
                </tr>
            </table>          
        </td>

    </tr>
    <tr>
        <td>
            <table>
                <tr>
                    <td>
                        <span id="imgMessage"></span>
                    </td>
                </tr>
            </table>
             <div class="content">
			    <div id="myGallery" class="photoslider">
				<%--<div class="imageElement">
					<h3>Item 1 Title</h3>
					<p>Item 1 Description</p>
					<a href="../../Content/img/shop/81/8/1.jpg" title="open image" class="open"></a>
					<img src="../../Content/img/shop/81/8/1.jpg" class="full" />
					<img src="../../Content/img/shop/81/8/1.jpg" class="thumbnail" />
				</div>
				<div class="imageElement">
					<h3>Item 2 Title</h3>
					<p>Item 2 Description</p>
					<a href="../../Content/img/shop/81/03/2/1/1.jpg" title="open image" class="open"></a>
					<img src="/Content/img/shop/81/03/2/1/1.jpg" class="full" />
					<img src="/Content/img/shop/81/03/2/1/1.jpg" class="thumbnail" />
				</div>
				<div class="imageElement">
					<h3>Item 5 Title</h3>
					<p>Item 5 Description</p>
					<a href="../../Content/img/shop/81/03/2/2/2.jpg" title="open image" class="open"></a>
					<img src="/Content/img/shop/81/03/2/2/2.jpg" class="full" />
					<img src="/Content/img/shop/81/03/2/2/2.jpg" class="thumbnail" />
				</div>--%>
			</div>
		     </div>
        </td>
    </tr>
</table>

</asp:Content>
